-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feedback button #962
Add feedback button #962
Conversation
86b6fd3
to
f229b26
Compare
@lognaturel's first Composition API component, woohoo! 🎉
I think the easiest thing would be to use src/config.js to configure whether the button is shown. We similarly use src/config.js for the customizations on the homepage. Trying to apply changes to
That makes sense to me to have it in the code base.
Almost none of our other sizes are relative, in part because Bootstrap 3 didn't use relative sizes. No harm in using relative sizes here though! Other ideas for data that Frontend could pass to the form:
Should I do a quick first round of code review now? |
Ah, yes, sure!
These are all great ideas. How about we see what kind of feedback we get and add accordingly. I'd prefer to capture the minimum amount of information we need to make good decisions. My first reaction was to get excited about all of these but they're kind of on the edge of PII and if we don't have to collect them to get value, maybe it's better that we don't.
Please! I imagine it will be fast. |
Putting this one in your court @matthew-white with two todos I can't quickly figure out!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote some comments about the previous commit f229b26, and @lognaturel and I reviewed them interactively. A lot of the comments have been resolved already, but I thought it'd help to make them visible on the PR. I'll work on making those remaining small changes, then I'll merge. 🚀
What a literal edge case! I would tend to leave it as-is for now and file an issue. I can look into growing the button instead of moving it while regression testing is ongoing but I also think it would be ok to release as-is. This is primarily based on the belief that it's rare for folks to use the actual scrollbar. I'm sure there are good accessibility reasons to do so in which case it would still be possible to use unless the screen is extremely short or there's a huge amount of content in the modal. |
@@ -249,7 +249,7 @@ describe('App', () => { | |||
config: { showsFeedbackButton: true } | |||
}; | |||
|
|||
const app = await load('/', { container }); | |||
const app = await load('/login', { container }).restoreSession(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am annoyed! This is different from loading '/' with restoreSession(false)
? I'm pretty sure I had tried that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should be the same! restoreSession(false)
is the key part. I just changed it to /login because navigating to / when you're logged out will send you to /login. Might as well go there right away haha.
}); | ||
|
||
/* visiblyLoggedIn.value is `true` if the user not only has all the data from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, nice!
I approve of and appreciate your updates, @matthew-white! Looks good to go to me. |
const visiblyLoggedIn = computed(() => currentUser.dataExists && | ||
router.currentRoute.value !== START_LOCATION && | ||
router.currentRoute.value.path !== '/login'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adapted visiblyLoggedIn
from the loggedIn
computed property in Navbar
. I also added a check that the current route isn't START_LOCATION
so that visiblyLoggedIn.value
is false
throughout the initial navigation. The initial navigation is async because it attempts to restore the session. During the navigation, we don't show the navbar, and this additional check means that the feedback button also won't be shown.
it('indicates if the user is not logged in', () => { | ||
const navbar = mount(Navbar, { | ||
container: { router: mockRouter('/login') }, | ||
global: { | ||
// Stubbing AnalyticsIntroduction because of its custom <router-link> | ||
stubs: { AnalyticsIntroduction: true } | ||
} | ||
}); | ||
const text = navbar.getComponent(NavbarActions).get('a').text(); | ||
text.should.equal('Not logged in'); | ||
}); | ||
it('indicates if the user is not logged in', () => | ||
load('/login') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also could have patched the test by injecting visiblyLoggedIn
. However, I think it's a better test to call load()
and mount App
. That way, the test will actually use visiblyLoggedIn
as provided by App
.
@@ -249,7 +249,7 @@ describe('App', () => { | |||
config: { showsFeedbackButton: true } | |||
}; | |||
|
|||
const app = await load('/', { container }); | |||
const app = await load('/login', { container }).restoreSession(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should be the same! restoreSession(false)
is the key part. I just changed it to /login because navigating to / when you're logged out will send you to /login. Might as well go there right away haha.
Closes getodk/central#616
Opening this as draft so the new component can be reviewed and the general approach can be discussed.
Design
Proposed plan
What has been done to verify that this works as intended?
Manual verification only. Made some test submissions.
Why is this the best possible solution? Were any other approaches considered?
I considered doing this as a blob of markup we'd paste in just for ODK Cloud users initially or keeping the component private. However, I think it's simpler to have it in the code base. We don't particularly mind if self-hosters want to enable this using our public survey or their own -- we just want to roll it out to Cloud customers only initially to test out the idea ("meta-feedback").
One possible downside of this approach is that someone ill-intentioned could use the public form to spam us. We have mitigations in place for that and worse case we could close the form.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
The feedback button component is new so should be very low risk. We need to decide exactly how we want to enable it for Cloud and that could carry some risk because it has logic.
Does this change require updates to user documentation? If so, please file an issue here and include the link below.
I don't think so.
Before submitting this PR, please make sure you have:
npm run test
andnpm run lint
and confirmed all checks still pass OR confirm CircleCI build passes